package com.xjoyt.pay.master.repository;

import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;

import com.xjoyt.pay.master.dao.CompanyRateRepositoryCustom;
import com.xjoyt.pay.master.po.CompanyRate;
import com.xjoyt.pay.repository.Repository;
import com.xjoyt.pay.vo.PayType;

public interface CompanyRateRepository extends Repository<CompanyRate>, CompanyRateRepositoryCustom {

	@Query(" select a from CompanyRate a where a.company.id = ?1 ")
	List<CompanyRate> findAllByCompanyId(String companyId);

	@Query(" select a from CompanyRate a where a.company.id in ?1 ")
	List<CompanyRate> findAllByCompanyIdIn(List<String> companyIds);

	@Query(" select a from CompanyRate a where a.company.id = ?1 and a.type= ?2 ")
	Page<CompanyRate> findAllByCompanyIdAndType(String companyId, PayType type, Pageable pageable);

}
